#!/user/bin/env python3
# -*- coding: utf-8 -*-
"""
目标：unittest框架 -TestSuite使用
操作：
    1.导包
    2.实例化TestSuite对象
    3.调用addTestfang方法添加用例或者类名到指定的套件中
    4.执行测试套件
"""
# import time
# import unittest
#
# from test_unittest_skip import *
# from review.my_utils.HTMLTestRunner import HTMLTestRunner
#
# suit = unittest.TestLoader().discover("./")
# report_dir = f"../../static/html/{time.strftime('%Y-%m-%d %H-%M-%S')}.html"
# with open(report_dir, "wb") as f:
#     HTMLTestRunner(stream=f, verbosity=2, title="深兰SaaS项目测试报告", description="操作系统 win10").run(suit)
from selenium import webdriver

driver = webdriver.Chrome()
print("出错了")
try:
    assert 1 == 3
except Exception:
    driver.get_screenshot_as_file("../../static/img/error.png")
raise Exception